home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / nihcl-30.lha / nihcl-3.0 / lib / OIOTbl.h < prev    next >
C/C++ Source or Header  |  1990-05-19  |  2KB  |  58 lines

  1. #ifndef OIOTBL_H
  2. #define OIOTBL_H
  3.  
  4. /*$Header: /afs/alw.nih.gov/unix/sun4_40c/usr/local/src/nihcl-3.0/share/lib/RCS/OIOTbl.h,v 3.0 90/05/20 00:20:25 kgorlen Rel $*/
  5.  
  6. /* OIOTbl.h -- Specification of tables used by storeOn()/readFrom()
  7.  
  8.     THIS SOFTWARE FITS THE DESCRIPTION IN THE U.S. COPYRIGHT ACT OF A
  9.     "UNITED STATES GOVERNMENT WORK".  IT WAS WRITTEN AS A PART OF THE
  10.     AUTHOR'S OFFICIAL DUTIES AS A GOVERNMENT EMPLOYEE.  THIS MEANS IT
  11.     CANNOT BE COPYRIGHTED.  THIS SOFTWARE IS FREELY AVAILABLE TO THE
  12.     PUBLIC FOR USE WITHOUT A COPYRIGHT NOTICE, AND THERE ARE NO
  13.     RESTRICTIONS ON ITS USE, NOW OR SUBSEQUENTLY.
  14.  
  15. Author:
  16.     K. E. Gorlen
  17.     Computer Systems Laboratory, DCRT
  18.     National Institutes of Health
  19.     Bethesda, MD 20892
  20.     July, 1988
  21.  
  22. Modification History:
  23.  
  24. $Log:    OIOTbl.h,v $
  25.  * Revision 3.0  90/05/20  00:20:25  kgorlen
  26.  * Release for 1st edition.
  27.  * 
  28. */
  29.  
  30. #include "IdentDict.h"
  31. #include "OrderedCltn.h"
  32.  
  33. class StoreOnTbl : public NIHCL {
  34.     IdentDict d;            // object address => object number
  35.     int objNum;            // last object number used
  36.     OrderedCltn c;            // table of classes stored, indexed by class number
  37.     unsigned short classNum;    // last class number used
  38. public:
  39.     StoreOnTbl(unsigned size =256);
  40.     ~StoreOnTbl();
  41.     bool add(const Object&, int& num);
  42.     bool addClass(const Class*, unsigned short& num);
  43.     void addMember(const Object&);
  44. };
  45.  
  46. class ReadFromTbl : public NIHCL {
  47.     OrderedCltn obs;    // table of objects for readFrom()
  48.     OrderedCltn cls;    // table of classes for readFrom()
  49. public:
  50.     ReadFromTbl(unsigned size =1024);
  51.     int add(Object&);
  52.     int add(const Class*);
  53.     Object* objectAt(int);
  54.     const Class* classAt(int);
  55. };
  56.  
  57. #endif
  58.